package com.gljx.web.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.gljx.web.Entity.SystemParameter;
import com.gljx.web.dao.CommonDao;
import com.gljx.web.dao.SystemParameterMapper;
import com.gljx.web.service.SystemParameterService;

@Transactional
@Service
public class SystemParameterServiceImpl extends CommonDao implements SystemParameterService{

	@Autowired
	private SystemParameterMapper systemParameterMapper;
	
	/**
	 * 实现根据公司id查询
	 */
	@Override
	public List<SystemParameter> querySysParameterByFcontrolunitId(String companyId) {
		// TODO Auto-generated method stub
		return systemParameterMapper.selectSysParameterByFcontrolunitId(companyId);
	}

	/**
	 * 实现根据名称查询
	 */
	@Override
	public List<SystemParameter> querySysetmParamenterByFnameL2(String fcompanyId, String fnameL2) {
		// TODO Auto-generated method stub
		Map<String, String> map = new HashMap<>();
		map.put("fcompanyId", fcompanyId);
		map.put("fnameL2", fnameL2);
		return systemParameterMapper.selectSysetmParamenterByFnameL2(map);
	}

	/**
	 * 实现添加系统参数
	 */
	@Override
	public void addSystemParameter(SystemParameter systemParameter) {
		// TODO Auto-generated method stub
		systemParameterMapper.insertSelective(systemParameter);
	}

	/**
	 * 根据fid查询
	 */
	@Override
	public SystemParameter quertSystemParameterByFid(String fid) {
		// TODO Auto-generated method stub
		return systemParameterMapper.selectByPrimaryKey(fid);
	}

	/**
	 * 实现修改
	 */
	@Override
	public void mofidySystemParameter(SystemParameter systemParameter) {
		// TODO Auto-generated method stub
		systemParameterMapper.updateByPrimaryKeySelective(systemParameter);
	}

	@Override
	public void deleteSystemParameter(String fid) {
		// TODO Auto-generated method stub
		systemParameterMapper.deleteByPrimaryKey(fid);
	}

	@Override
	public SystemParameter querySysetmParamenterByName(String fcompanyid, String name) {
		return systemParameterMapper.selectSysetmParamenterByName(fcompanyid, name);
	}

}
